home *** CD-ROM | disk | FTP | other *** search
- { -----------------------------------------------------------------------------
- NOTICE:
-
- THESE MATERIALS are UNSUPPORTED by OSS! If you do not understand how to
- use them do not contact OSS for help! We will not teach you how to
- program in Pascal. If you find an error in these materials, feel free
- to SEND US A LETTER explaining the error, and how to fix it.
-
-
- THE BOTTOM LINE:
-
- Use it, enjoy it, but you are on your own when using these materials!
-
-
- DISCLAIMER:
-
- OSS makes no representations or warranties with respect to the contents
- hereof and specifically disclaim all warranties of merchantability or
- fitness for any particular purpose. This document is subject to change
- without notice.
-
- OSS provides these materials for use with Personal Pascal. Use them in
- any way you wish.
-
-
- -------------------------------------------------------------------------- }
-
-
- {**************************************************************************
-
- Program: JOYTEST.PAS
-
- 11/17/86 MER
-
- This program demonstrates how to call the routines
- in the joysubs.o module.
-
- LINK with JOYSUBS.O ( type "JOYSUBS.O" in the ADDITIONAL LINK FILES
- area in LINKER OPTIONS... menu selection ).
-
- **************************************************************************}
-
- PROGRAM joytest;
-
- VAR c: char;
-
- { These 3 routines are in the joysubs file-- we need to declare them EXTERNAL
- here: }
-
- { Call this before calling Stick() to turn off the mouse }
-
- PROCEDURE Init_Stick;
- EXTERNAL;
-
- { Call this to turn the mouse back on }
-
- PROCEDURE End_Stick;
- EXTERNAL;
-
-
- { Call this routine to get the current joystick value. The values returned
- for the eight directions are as follows:
-
- 5 1 9
- \|/ If the trigger is depressed, then 128 will be added to the
- 4--0--8 direction value
- /|\
- 6 2 10
-
- "which_stick" should be given the value 0 or 1. }
-
- FUNCTION Stick( which_stick: integer ): integer;
- EXTERNAL;
-
-
- BEGIN
- Init_Stick;
- REPEAT
- writeln( Stick(0):2:h, ' ', Stick(1):2:h );
- UNTIL keypress;
- read(c);
- End_Stick;
- END.
-
- { End of file: JOYTEST.PAS }
-